export default[
    {
        path:"/Header",
        name:"Header",
        component:()=>import("../components/Header/Header.vue")
    },
    {
        path:"Footer",
        name:"Footer",
        component:()=>import("../components/Footer/Footer.vue")
    },
    {
        path:"/Home",
        name:"Home",
        component:()=>import("../views/Home/Home.vue")
    },
    {
        path:"/Login",
        name:"Login",
        component:()=>import("../views/Login/index.vue"),
        meta:{
            Isshow:true
        }
    },
    {
        path:"/Register",
        name:"Register",
        component:()=>import("../views/Register/index.vue"),
        meta:{
            Isshow:true
        }
    },
    {
        path:"/Search",
        name:"Search",
        component:()=>import("../views/Search/Search.vue")
    },
    {
        path:"/Trade",
        name:"Trade",
        component:()=>("../views/Trade/index.vue"),
        beforeEnter: (to, from, next) => {
            if (from.name === "shopCart") {
              next();
            } else {
              next("/shopCart");
            }
          },
    },
    {
        path:"/Pay",
        name:"Pay",
        component:()=>("../views/Pay/index.vue"),
        beforeEnter: (to, from, next) => {
            if (from.name === "Trade") {
              next();
            } else {
              next("/shopCart");
            }
          },
    },
    {
        path:"/paySuccess",
        name:"PaySuccess",
        component:()=>("../views/PaySuccess/index.vue"),
        beforeEnter: (to, from, next) => {
            if (from.name === "Pay") {
              next();
            } else {
              next("/shopCart");
            }
          },
    },
    {
        path:"/Center",
        name:"Center",
        component:()=>import("@/views/Center"),
        redirect:"/Center/Myorder",
        children:[
            {
                path: "MyOrder",
                name: "MyOrder",
                component: () => import("@/views/Center/components/MyOrder"),
              },
              {
                path: "TeamOrder",
                name: "TeamOrder",
                component: () => import("@/views/Center/components/TeamOrder"),
              },
        ]
    },
    {
        path:"/",
        redirect:"/Home"
    },
    {
        path:"/*",
        component:()=>import("../views/404/404.vue"),
        
    }
]